import {
	http
} from "@/common/request.js";

// 开始考试抽查
export function startTestCheck(examId) {
  return http.request({
    url: `/manager/examSpotCheck/startExam/${examId}`,
    method: "post",
  });
}
// 结束抽查考试
export function endTestCheck(examPaperId) {
  return http.request({
    url: `/manager/examSpotCheck/endExam/${examPaperId}`,
    method: "post",
  });
}
// 考核抽查补考申请

export function ApplyTestCheck(examPaperId) {
  return http.request({
    url: `/manager/examSpotCheck/examApply/${examPaperId}`,
    method: "post",
  });
}
// 审批考核抽查补考申请
export function againApplyTestCheck(data) {
  return http.request({
    url: `/manager/examSpotCheck/approvalExamApply`,
    method: "put",
    data:data,
  });
}
// ---------------------------------------------------
// 批改试卷
export function gradeExamPaperTopic(data) {
  return http.request({
    url: `/exam/tea/gradeExamPaperTopic`,
    method: "post",
    data:data
  });
}

// 获取剩余补考次数
export function getExamApplyTimes(examPaperId) {
  return http.request({
    url: `/student/examApply/getExamApplyTimes/${examPaperId}`,
    method: "get",
  });
}
// 查询考试配置详细
export function getExam(id) {
    return http.request({
      url: '/exam/manager/' + id,
      method: 'get'
    })
}
// 获取开始考试内容
export function getStartExam(examId,courseStuId) {
  return http.request({
    url: `/exam/stu/startExam/${examId}/${courseStuId}`,
    method: "post",
  });
}
// 提交答案
export function submitSingleAnswer(data) {
  return http.request({
    url: "/exam/stu/submitAnswer",
    method: "post",
    data: data,
  });
}
// 结束考试
export function finshExamPaper(examId) {
  return http.request({
    url: "/exam/stu/endExam/" + examId,
    method: "post",
  });
}
// 获取习题详情
export function getExamPaper(id) {
  return http.request({
    url: "/exam/stu/getExamPaper/" + id,
    method: "get",
  });
}

// 新增补考申请
export function examApply(examId, type,courseStuId) {
  return http.request({
    url: `/student/examApply/${examId}/${type}/${courseStuId}`,
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  });
}
// 获取重修
export function reStart(courseSchedulingId,studentId) {
  return http.request({
    url: `/student/courseStudyManager/reStart/${courseSchedulingId}/${studentId}`,
    method: "post",
  });
}